﻿import { Component, EventEmitter, Injector, Output, ViewChild } from '@angular/core';
import { AppComponentBase } from '@shared/common/app-component-base';
import { PasswordComplexitySetting, ProfileServiceProxy, UserEditDto, UserServiceProxy } from '@shared/service-proxies/service-proxies';
import { ModalDirective } from 'ngx-bootstrap';
import { TaskForStandardPartsDto } from '@shared/service-proxies/service-proxies';
import { TestDataServiceProxy } from '@shared/service-proxies/service-proxies';
@Component({
    selector: 'stockForStandardsEditComponent',
    templateUrl: './stockforstandards_edit.component.html',
    styles: [`.user-edit-dialog-profile-image {
             margin-bottom: 20px;
        }`
    ]
})
export class StockForStandardsEditComponent extends AppComponentBase {
    @ViewChild('createOrEditModal') modal: ModalDirective;
    @Output() modalSave: EventEmitter<any> = new EventEmitter<any>();
    active = false;
    saving = false;
    passwordComplexitySetting: PasswordComplexitySetting = new PasswordComplexitySetting();
    formData: TaskForStandardPartsDto = new TaskForStandardPartsDto();
    user: UserEditDto = new UserEditDto();
    passwordComplexityInfo = '';
    profilePicture: string;
    
    constructor(
        injector: Injector,
        private _userService: UserServiceProxy,
        private _testDataServiceProxy: TestDataServiceProxy,
        private _profileService: ProfileServiceProxy
    ) {
        super(injector);
    }

    show(taskForStandardPartsDto?: TaskForStandardPartsDto): void {
        if (taskForStandardPartsDto) {
            this.formData = taskForStandardPartsDto;
        } else {
            this.formData = new TaskForStandardPartsDto();
        }
        this.active = true;
        this.modal.show();
    }

    onShown(): void {
        
    }
    save(): void {

    }

    close(): void {
        this.active = false;
        this.modal.hide();
    }
}
